import request from "@/utils/request";

/**
 * 获取计费规则列表
 * @export
 * @param {*} params
 * @returns
 */
export function getRuleListAPI(params) {
  return request.get("/parking/rule/list", { params });
}

/**
 * 添加计费规则
 * @export
 * @param {*} data
 * @returns
 */
export function addFeeRuleAPI(data) {
  return request.post("/parking/rule", data);
}

/**
 * 删除计费规则
 * @export
 * @param {*} id 规则id
 * @returns
 */
export function delRuleAPI(id) {
  return request.delete(`/parking/rule/${id}`);
}

/**
 * 回显计费规则
 * @export
 * @param {*} id 规则id
 * @returns
 */
export function getRuleAPI(id) {
  return request.get(`/parking/rule/${id}`);
}

/**
 * 提交编辑规则
 * @export
 * @param {*} data 一堆参数
 * @returns
 */
export function editRuleAPI(data) {
  return request.put("/parking/rule", data);
}

/**
 * 获取计费规则下拉列表
 * @returns {*}
 */
export function getRuleDropListApi() {
  return request({
    url: '/parking/rule/dropList'
  })
}